import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import Tree from '@feidao/widgets/fd-w000001';

export default async function a013(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	let data = '';
	const node_content = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="node-id"]').value;
	if (!node_content) {
		alert('请输入获取节点的id');
	} else {
		const tree = fd.data.node.querySelector<Tree>('#fd-w000001-001');
		data = tree.get_node_by_id(node_content);
	}
	fd.data.node.querySelector<HTMLTextAreaElement>('[data-feidao-id="fd-w000001-005"]').innerHTML = `let data = '';
	const node_content = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="node-id"]').value;
if (!node_content) {
	alert('请输入获取节点的id');
} else {
	const tree = fd.data.node.querySelector<Tree>('#fd-w000001-001');
	data = tree.get_node_by_id(node_content);
}

数据为== ${JSON.stringify(data)}
`;
}
